Introduction

Column

Background

The purpose of this project is to explore relationships among mental and physical health issues, and predictors of anxiety and depression among college students. While mental health is sometimes hard to measure, there are standardized methods developed to help psychologists evaluate the presence and severity of certain mental health indicators. In this project, we will focus mainly on depression and anxiety disorders in relation to overall mental health.

Our physical and mental health are not distinct from each other. It is important to view health from an overall perspective, because all areas of our lives cross over into each other.

Research Questions

  • What physical health issues are related to mental health outcomes?
  • How does the physical health and mental health (depression/anxiety scores) of students who receive mental health treatment (therapy, medication) compare to students that do not?
  • Are mental and physical health problems consistent across sex, race, and age?

Column

Data Description

Source

The data set comes from a study based on social media’s affects on college students’ mental health (Braghieri, et. al 2021). The data includes variables with information from PHQ-9 Depression Screening Surveys and GAD-7 Anxiety Screening Surveys. Both are highly reliable and valid in medical diagnoses. Additionally, there are survey questions derived from the American College Health Association (ACHA)’s National College Health Assessment (NCHA). This data set was originally used to evaluate the validity of the NCHA by comparing the outcomes to the PHQ-9 and the GAD-7, both of which were highly correlated to the poor mental health predictors of the NCHA. There are 509 observations.

Rows: 509
Columns: 88
$ RecordedDate                        <chr> "1/29/2022 15:37", "1/29/2022 15:4…
$ year_1                              <dbl> 2000, 1997, 2000, 2001, 2000, 2000…
$ state_1                             <chr> "Virginia", "California", "Marylan…
$ surveys                             <chr> "15", "15", "1", "7", "5", "30", "…
$ general_health                      <chr> "Good", "Excellent", "Very Good", …
$ phq9_interest                       <chr> "More than half of the days", "Not…
$ phq9_depressed                      <chr> "Several days", "Not at all", "Sev…
$ phq9_sleep                          <chr> "Several days", "Not at all", "Not…
$ phq9_tired                          <chr> "Several days", "Several days", "S…
$ phq9_appetite                       <chr> "Several days", "Several days", "N…
$ phq9_failure                        <chr> "More than half of the days", "Not…
$ phq9_concentrating                  <chr> "Several days", "Not at all", "Mor…
$ phq9_speed                          <chr> "Not at all", "Not at all", "Not a…
$ phq9_selfharm                       <chr> "Not at all", "Not at all", "Sever…
$ gad7_anxious                        <chr> "Several days", "Not at all", "Sev…
$ gad7_control                        <chr> "Several days", "Not at all", "Not…
$ gad7_worrying                       <chr> "Several days", "Not at all", "Not…
$ gad7_relaxing                       <chr> "Several days", "Not at all", "Not…
$ gad7_restless                       <chr> "Several days", "Not at all", "Not…
$ gad7_annoyed                        <chr> "Several days", "Not at all", "Mor…
$ gad7_afraid                         <chr> "Several days", "Not at all", "Sev…
$ acha_12months_times_hopeless        <chr> "5-6 times", "Never", "1-2 times",…
$ acha_12months_times_overwhelmed     <chr> "5-6 times", "11 or more times", "…
$ acha_12months_times_exhausted       <chr> "5-6 times", "5-6 times", "7-8 tim…
$ acha_12months_times_sad             <chr> "5-6 times", "3-4 times", "1-2 tim…
$ acha_12months_times_depressed       <chr> "1-2 times", "Never", "1-2 times",…
$ acha_12months_times_considerSuicide <chr> "Never", "Never", "1-2 times", "3-…
$ acha_12months_times_attemptSuicide  <chr> "Never", "Never", "Never", "Never"…
$ acha_12months_any_allergy           <chr> "No", "No", "No", "Yes", "No", "No…
$ acha_12months_any_anorexia          <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_anxiety           <chr> "Yes", "No", "No", "Yes", "Yes", "…
$ acha_12months_any_asthma            <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_bulimia           <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_fatigure          <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_depression        <chr> "Yes", "No", "No", "Yes", "Yes", "…
$ acha_12months_any_diabetes          <chr> "No", "No", "No", "No", "Yes", "No…
$ acha_12months_any_endometriosi      <chr> "No", "No", "No", "Yes", "No", "No…
$ acha_12months_any_herpes            <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_hpv               <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_hepatitis         <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_blood             <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_cholesterol       <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_HIV               <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_stressInjury      <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_seasonal          <chr> "Yes", "No", "No", "No", "No", "No…
$ acha_12months_any_substance         <chr> "No", "Yes", "No", "No", "No", "No…
$ acha_12months_any_back              <chr> "No", "Yes", "No", "No", "No", "Ye…
$ acha_12months_any_fracture          <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_bronchitis        <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_chlamydia         <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_ear               <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_gonorrhea         <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_mononucleosis     <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_pelvic            <chr> "No", "No", "No", "No", "No", "No"…
$ acha_12months_any_sinus             <chr> "No", "No", "No", "No", "Yes", "Ye…
$ acha_12months_any_strep             <chr> "No", "No", "No", "Yes", "No", "No…
$ acha_12months_any_tuberculosis      <chr> "No", "No", "No", "No", "No", "No"…
$ acha_services_dianosed              <chr> "No", NA, "No", "Yes", "No", NA, "…
$ acha_services_therapy               <chr> "Yes", NA, "No", "Yes", "Yes", NA,…
$ acha_services_medication            <chr> "Yes", NA, "No", "Yes", "Yes", NA,…
$ acha_depression                     <chr> "Yes", "No", "No", "Yes", "Yes", "…
$ sex                                 <chr> "Female", "Female", "Female", "Fem…
$ fulltime                            <chr> "Yes", "Yes", "Yes", "Yes", "Yes",…
$ international                       <chr> "No", "No", "No", "No", "No", "No"…
$ race                                <chr> "white", "asian", "asian", "white"…
$ phq9_interest1                      <dbl> 2, 0, 1, 2, 2, 1, 1, 1, 1, 1, 0, 1…
$ phq9_depressed1                     <dbl> 1, 0, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1…
$ phq9_sleep1                         <dbl> 1, 0, 0, 3, 2, 1, 2, 3, 3, 0, 1, 0…
$ phq9_tired1                         <dbl> 1, 1, 1, 3, 2, 2, 2, 1, 3, 2, 1, 2…
$ phq9_appetite1                      <dbl> 1, 1, 0, 3, 1, 1, 1, 3, 0, 1, 1, 1…
$ phq9_failure1                       <dbl> 2, 0, 0, 1, 2, 2, 1, 2, 1, 0, 1, 0…
$ phq9_concentrating1                 <dbl> 1, 0, 2, 3, 1, 2, 1, 1, 1, 0, 1, 0…
$ phq9_speed1                         <dbl> 0, 0, 0, 1, 0, 0, 1, 2, 1, 0, 0, 0…
$ phq9_selfharm1                      <dbl> 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 0, 0…
$ phq9_score                          <dbl> 9, 2, 6, 19, 14, 10, 10, 15, 11, 5…
$ phq9_severity                       <chr> "Mild", "None-minimal", "Mild", "M…
$ gad7_anxious1                       <dbl> 1, 0, 1, 1, 1, 1, 2, 2, 1, 3, 2, 3…
$ gad7_control1                       <dbl> 1, 0, 0, 0, 1, 2, 2, 1, 1, 3, 1, 3…
$ gad7_worrying1                      <dbl> 1, 0, 0, 1, 1, 2, 2, 2, 1, 3, 2, 3…
$ gad7_relaxing1                      <dbl> 1, 0, 0, 2, 1, 1, 2, 1, 2, 3, 2, 3…
$ gad7_restless1                      <dbl> 1, 0, 0, 2, 1, 0, 2, 1, 2, 2, 1, 1…
$ gad7_annoyed1                       <dbl> 1, 0, 2, 2, 2, 3, 2, 2, 0, 3, 1, 3…
$ gad7_afraid1                        <dbl> 1, 0, 1, 0, 1, 0, 2, 1, 0, 1, 0, 1…
$ gad7_score                          <dbl> 7, 0, 4, 8, 8, 9, 14, 10, 7, 18, 9…
$ gad7_severity                       <chr> "Mild Anxiety", "Minimal Anxiety",…
$ acha_services_diagnosed1            <chr> "No", NA, NA, "Yes", "No", NA, "No…
$ acha_services_therapy1              <chr> "Yes", NA, NA, "Yes", "Yes", NA, "…
$ acha_services_medication1           <chr> "Yes", NA, NA, "Yes", "Yes", NA, "…

PHQ-9

The PHQ-9 is a standardized survey used to screen and diagnose depression. Participants are asked how often they have been bothered by nine specific problems over the past two weeks and respond with one of the four answers:

  1. Not at all (+0)
  2. Several days(+1)
  3. More than half the days (+2)
  4. Nearly everyday (+3)

The nine prompts consist of the following:

  1. Little interest or pleasure in doing things
  2. Feeling down, depressed or hopeless
  3. Trouble falling asleep, staying asleep, or sleeping too much
  4. Feeling tired or having little energy
  5. Poor appetite or overeating
  6. Feeling bad about yourself - or that you’re a failure or have let yourself or your family down
  7. Trouble concentrating on things, such as reading the newspaper or watching television
  8. Moving or speaking so slowly that other people could have noticed. Or, the opposite - being so fidgety or restless that you have been moving around a lot more than usual
  9. Thoughts that you would be better off dead or of hurting yourself in some way

Surveys are then scored and indicate levels of depression based on this scale:

  • 0-4 None-minimal
  • 5-9 Mild
  • 10-14 Moderate
  • 15-19 Moderately Severe
  • 20-27 Severe

GAD-7

Similar to the PHQ-9, the GAD-7 another is standardized survey, but it is used to screen generalized anxiety disorder. Participants are asked how often they have been bothered by seven specific problems over the past two weeks and respond with one of the four answers:

  1. Not at all (+0)
  2. Several days(+1)
  3. More than half the days (+2)
  4. Nearly everyday (+3+)

The nine prompts consist of the following:

  1. Feeling nervous, anxious or on edge
  2. Not being able to stop or control worrying
  3. Worrying too much about different things
  4. Trouble relaxing
  5. Being so restless that it is hard to sit still
  6. Becoming easily annoyed or irritable
  7. Feeling afraid as if something awful might happen

Surveys are then scored and indicate levels of anxiety based on this scale:

  • 0-4 Minimal anxiety
  • 5-9 Mild anxiety
  • 10-14 Moderate anxiety
  • 15+ Severe anxiety

NCHA

The National College Health Assessment is a semi-annual survey administered to college students by the ACHA. The current data utilizes the survey questions, but not the data collected from the ACHA.

The data includes the following prompts from the survey:

Depression Symptoms:

  • Feeling things were hopeless
  • Feeling overwhelmed by all they had to do
  • Feeling very sad
  • Feeling so depressed it was difficult to function
  • Seriously considering attempting suicide
  • Attempting suicide

Possible Responses:

  • Never
  • 1-2 times
  • 3-4 times
  • 5-6 times
  • 7-8 times
  • 9-10 times
  • 11 or more times

General Health Indicators: Reported any of the following in the past 12 months:

  • Allergy problems
  • Anorexia
  • Anxiety disorder
  • Asthma
  • Bulimia
  • Chronic fatigue syndrome
  • Depression
  • Diabetes
  • Endometriosis
  • Genital herpes
  • Genital warts/HPV
  • Hepatitis B or C
  • High blood pressure
  • High cholesterol
  • HIV infection
  • Repetitive stress injury
  • Seasonal affective disorder
  • Substance abuse problem
  • Back pain
  • Broken bone/fracture
  • Bronchitis
  • Chlamydia
  • Ear infection
  • Gonorrhea
  • Mononucleosis
  • Pelvic inflammatory disease
  • Sinus infection
  • Strep throat
  • Tuberculosis

Possible Responses:

  • Yes/No
  • NA

If diagnosed with depression:

  • Diagnosed with depression in the last school year
  • Currently in therapy for depression
  • Currently taking medication for depression

Possible Responses:

  • Yes/No
  • NA

Data Cleaning

Many variables that were not useful for the research questions and were removed from the data set. Most of these include timestamps from clicks in the survey and other online browser information.

Other variables were created and transformed for ease of use. For example, race was condensed into one category with information for all races as opposed to 6 different variables with two levels.

Additionally, variables were created to represent the overall depression and anxiety scores from the PHQ-9 and GAD-7 screening results.

EDA

Column

Discussion

PHQ-9:GAD-7

Figure 1

This graph provides some insight into the relationship between overall PHQ-9 and GAD-7 scores. The R-Squared = 0.605 and the regression line is fitted by a linear regression between the variables. There is a moderate, positive relationship between the depression and anxiety scores based on these survey questions.

PHQ-9 Results

Figure 2

Figure 2 shows the distribution of depression severity based on the PHQ-9. Most students fall under the Mild category, with less having more severe scores.

GAD-7 Results

Figure 3

Figure 3 shows the distribution of anxiety severity based on the GAD-7. The results are similar to the distribution of depression, with most students exhibiting symptoms equivalent to mild anxiety and less facing severe symptoms.

Sex

Figure 4

Figure 4 shows how many male and female students are included in the dataset. There are approximately 350 females and 150 males.

Race

Figure 5

Most students identify as white, with almost 300 students reporting so. All students who idenfied as more than one race are classified as “other”.

Age

Figure 6

Most students were born in the year 2000, with a long tail representing multiple older students also represented in the sample. Note: This data was collected in January 2022, so most students born in 2000 are around 21 years old.

Physical Health

Figure 7

This graph shows the amount of people who responded “yes” to experiencing each of the symptoms/disorders listed in the past 12 months. Anxiety, depression, allergies, and back pain are among the most common.

It is worth noting these measures of depression and anxiety are different from the PHQ-9 and GAD-7 scales, and were an independent, self-reported question in the NCHA questionnaire.

Column

Corresponding Graphs

Fig. 1

Fig. 2

Fig. 3

Fig. 4

Fig. 5

Fig. 6

Fig. 7

Methods

Column

1

2

gekk

Column

Model


 No Yes 
275 133 

 No Yes 
 64  37 

Call:
glm(formula = acha_depression_01 ~ sex + race + year_1 + phq9_score + 
    gad7_score + general_health, family = binomial, data = train)

Coefficients:
                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)             145.37538   48.32911   3.008 0.002629 ** 
sexMale                  -0.34449    0.27455  -1.255 0.209574    
raceblack                -0.37417    0.73117  -0.512 0.608834    
racehispanic              0.66731    0.49416   1.350 0.176885    
raceother                 0.83632    0.51258   1.632 0.102766    
racewhite                 1.32422    0.37300   3.550 0.000385 ***
year_1                   -0.07419    0.02416  -3.071 0.002131 ** 
phq9_score                0.11448    0.03121   3.668 0.000245 ***
gad7_score               -0.04929    0.03292  -1.497 0.134387    
general_healthFair        0.76431    0.63969   1.195 0.232160    
general_healthGood        0.63939    0.59108   1.082 0.279375    
general_healthPoor        1.68661    0.77067   2.188 0.028635 *  
general_healthVery Good   0.54631    0.59794   0.914 0.360895    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 515.14  on 407  degrees of freedom
Residual deviance: 442.18  on 395  degrees of freedom
AIC: 468.18

Number of Fisher Scoring iterations: 4

Call:
glm(formula = acha_depression_01 ~ sex + race + year_1 + acha_12months_any_allergy + 
    acha_12months_any_asthma + acha_12months_any_back + acha_12months_any_blood + 
    acha_12months_any_bronchitis + acha_12months_any_cholesterol + 
    acha_12months_any_diabetes + acha_12months_any_ear + acha_12months_any_endometriosi + 
    acha_12months_any_fatigure + acha_12months_any_hepatitis + 
    acha_12months_any_pelvic + acha_12months_any_sinus + acha_12months_any_strep + 
    acha_12months_any_stressInjury + acha_12months_any_tuberculosis + 
    general_health, family = binomial, data = train)

Coefficients:
                                   Estimate Std. Error z value Pr(>|z|)    
(Intercept)                       104.68619   49.48934   2.115 0.034402 *  
sexMale                            -0.40080    0.27986  -1.432 0.152096    
raceblack                          -0.36919    0.73219  -0.504 0.614100    
racehispanic                        0.57032    0.50800   1.123 0.261566    
raceother                           0.91496    0.54025   1.694 0.090346 .  
racewhite                           1.26868    0.37922   3.346 0.000821 ***
year_1                             -0.05372    0.02473  -2.173 0.029793 *  
acha_12months_any_allergyYes        0.21398    0.25352   0.844 0.398661    
acha_12months_any_asthmaYes         0.64099    0.35269   1.817 0.069151 .  
acha_12months_any_backYes           0.23919    0.24844   0.963 0.335652    
acha_12months_any_bloodYes         -0.43401    0.57323  -0.757 0.448974    
acha_12months_any_bronchitisYes    -0.47910    0.76505  -0.626 0.531166    
acha_12months_any_cholesterolYes    0.46906    0.58020   0.808 0.418839    
acha_12months_any_diabetesYes       2.10914    1.18240   1.784 0.074459 .  
acha_12months_any_earYes            0.36444    0.53069   0.687 0.492255    
acha_12months_any_endometriosiYes   0.84044    0.83113   1.011 0.311923    
acha_12months_any_fatigureYes       0.05289    0.48733   0.109 0.913581    
acha_12months_any_hepatitisYes      1.01933    1.99811   0.510 0.609951    
acha_12months_any_pelvicYes        -1.12601    2.07489  -0.543 0.587348    
acha_12months_any_sinusYes         -0.02874    0.31204  -0.092 0.926619    
acha_12months_any_strepYes         -0.17350    0.42806  -0.405 0.685239    
acha_12months_any_stressInjuryYes   0.08513    0.56033   0.152 0.879241    
acha_12months_any_tuberculosisYes -14.68387  535.41877  -0.027 0.978121    
general_healthFair                  1.09215    0.63196   1.728 0.083955 .  
general_healthGood                  0.90145    0.58451   1.542 0.123019    
general_healthPoor                  1.95796    0.80116   2.444 0.014529 *  
general_healthVery Good             0.59285    0.59520   0.996 0.319227    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 515.14  on 407  degrees of freedom
Residual deviance: 446.57  on 381  degrees of freedom
AIC: 500.57

Number of Fisher Scoring iterations: 12

Call:
glm(formula = acha_depression_01 ~ sex + race + year_1 + acha_12months_any_anorexia + 
    acha_12months_any_anxiety + acha_12months_any_bulimia + acha_12months_any_blood + 
    acha_12months_any_bronchitis + acha_12months_any_cholesterol + 
    acha_12months_any_depression + acha_12months_any_herpes + 
    acha_12months_any_hpv + acha_12months_any_HIV + acha_12months_any_seasonal + 
    acha_12months_any_substance + acha_12months_any_chlamydia + 
    acha_12months_any_gonorrhea + acha_12months_any_mononucleosis + 
    general_health, family = binomial, data = train)

Coefficients:
                                     Estimate Std. Error z value Pr(>|z|)    
(Intercept)                         182.83294   67.84713   2.695  0.00704 ** 
sexMale                               0.20936    0.41205   0.508  0.61139    
raceblack                            -1.13158    0.85762  -1.319  0.18702    
racehispanic                          0.59847    0.64535   0.927  0.35374    
raceother                             0.67669    0.72304   0.936  0.34933    
racewhite                             1.36900    0.51759   2.645  0.00817 ** 
year_1                               -0.09373    0.03394  -2.762  0.00575 ** 
acha_12months_any_anorexiaYes        -1.23366    0.62469  -1.975  0.04829 *  
acha_12months_any_anxietyYes          1.09342    0.39879   2.742  0.00611 ** 
acha_12months_any_bulimiaYes          0.64044    0.75661   0.846  0.39729    
acha_12months_any_bloodYes           -1.27045    0.72711  -1.747  0.08059 .  
acha_12months_any_bronchitisYes      -0.49642    0.85238  -0.582  0.56030    
acha_12months_any_cholesterolYes     -0.22546    0.70531  -0.320  0.74923    
acha_12months_any_depressionYes       3.42833    0.38732   8.852  < 2e-16 ***
acha_12months_any_herpesYes           0.77435    1.95422   0.396  0.69192    
acha_12months_any_hpvYes              2.39706    1.88855   1.269  0.20435    
acha_12months_any_HIVYes            -33.78101 2058.24531  -0.016  0.98691    
acha_12months_any_seasonalYes         0.18902    0.40446   0.467  0.64026    
acha_12months_any_substanceYes        0.99055    0.64239   1.542  0.12308    
acha_12months_any_chlamydiaYes        1.28855    1.41627   0.910  0.36291    
acha_12months_any_gonorrheaYes       17.76550 1455.39890   0.012  0.99026    
acha_12months_any_mononucleosisYes    0.64815    1.29923   0.499  0.61787    
general_healthFair                    0.68607    0.82714   0.829  0.40685    
general_healthGood                    0.29145    0.77594   0.376  0.70720    
general_healthPoor                    1.16951    1.00704   1.161  0.24551    
general_healthVery Good               0.26623    0.78974   0.337  0.73603    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 515.14  on 407  degrees of freedom
Residual deviance: 258.88  on 382  degrees of freedom
AIC: 310.88

Number of Fisher Scoring iterations: 14
acha_12months_any_gonorrhea
 No Yes 
506   3 

 No Yes 
406   2 

Call:
glm(formula = acha_depression_01 ~ sex + race + year_1 + acha_12months_any_anorexia + 
    acha_12months_any_anxiety + acha_12months_any_bulimia + acha_12months_any_blood + 
    acha_12months_any_bronchitis + acha_12months_any_cholesterol + 
    acha_12months_any_depression + acha_12months_any_herpes + 
    acha_12months_any_hpv + acha_12months_any_HIV + acha_12months_any_seasonal + 
    acha_12months_any_substance + acha_12months_any_chlamydia + 
    acha_12months_any_mononucleosis + acha_12months_any_allergy + 
    acha_12months_any_asthma + acha_12months_any_back + acha_12months_any_blood + 
    acha_12months_any_bronchitis + acha_12months_any_cholesterol + 
    acha_12months_any_diabetes + acha_12months_any_ear + acha_12months_any_endometriosi + 
    acha_12months_any_fatigure + acha_12months_any_hepatitis + 
    acha_12months_any_pelvic + acha_12months_any_sinus + acha_12months_any_strep + 
    acha_12months_any_stressInjury + general_health, family = binomial, 
    data = train)

Coefficients:
                                    Estimate Std. Error z value Pr(>|z|)    
(Intercept)                        176.91113   73.47297   2.408  0.01605 *  
sexMale                              0.22157    0.44033   0.503  0.61483    
raceblack                           -1.07790    0.93189  -1.157  0.24740    
racehispanic                         0.57350    0.69207   0.829  0.40729    
raceother                            1.20341    0.79366   1.516  0.12945    
racewhite                            1.61169    0.54971   2.932  0.00337 ** 
year_1                              -0.09087    0.03676  -2.472  0.01344 *  
acha_12months_any_anorexiaYes       -1.26806    0.64498  -1.966  0.04929 *  
acha_12months_any_anxietyYes         1.12118    0.41867   2.678  0.00741 ** 
acha_12months_any_bulimiaYes         0.77601    0.77839   0.997  0.31880    
acha_12months_any_bloodYes          -1.07135    0.76219  -1.406  0.15984    
acha_12months_any_bronchitisYes     -1.11971    0.96716  -1.158  0.24697    
acha_12months_any_cholesterolYes    -0.43014    0.77641  -0.554  0.57957    
acha_12months_any_depressionYes      3.60869    0.41065   8.788  < 2e-16 ***
acha_12months_any_herpesYes          3.19156    1.51269   2.110  0.03487 *  
acha_12months_any_hpvYes             2.69665    2.00895   1.342  0.17949    
acha_12months_any_HIVYes           -19.73801  882.76160  -0.022  0.98216    
acha_12months_any_seasonalYes        0.26618    0.44153   0.603  0.54661    
acha_12months_any_substanceYes       0.96999    0.68454   1.417  0.15648    
acha_12months_any_chlamydiaYes       0.76344    1.37100   0.557  0.57763    
acha_12months_any_mononucleosisYes   0.76147    1.47864   0.515  0.60657    
acha_12months_any_allergyYes         0.13980    0.36510   0.383  0.70178    
acha_12months_any_asthmaYes          0.55782    0.52277   1.067  0.28595    
acha_12months_any_backYes           -0.08049    0.36619  -0.220  0.82602    
acha_12months_any_diabetesYes        2.04013    1.50091   1.359  0.17406    
acha_12months_any_earYes             1.22705    0.74579   1.645  0.09991 .  
acha_12months_any_endometriosiYes    0.67545    1.37549   0.491  0.62338    
acha_12months_any_fatigureYes       -1.05944    0.66545  -1.592  0.11137    
acha_12months_any_hepatitisYes       1.62925    3.39041   0.481  0.63084    
acha_12months_any_pelvicYes         -1.36295    3.48193  -0.391  0.69548    
acha_12months_any_sinusYes          -0.75049    0.44727  -1.678  0.09336 .  
acha_12months_any_strepYes          -0.04781    0.58316  -0.082  0.93466    
acha_12months_any_stressInjuryYes    0.10564    0.82998   0.127  0.89871    
general_healthFair                   0.49126    0.88670   0.554  0.57955    
general_healthGood                   0.22825    0.80970   0.282  0.77802    
general_healthPoor                   1.11352    1.08721   1.024  0.30574    
general_healthVery Good              0.22503    0.82483   0.273  0.78499    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 515.14  on 407  degrees of freedom
Residual deviance: 248.94  on 371  degrees of freedom
AIC: 322.94

Number of Fisher Scoring iterations: 13
acha_12months_any_tuberculosis
 No Yes 
507   2 
                                    GVIF Df GVIF^(1/(2*Df))
sex                             1.303618  1        1.141761
race                            2.361095  4        1.113369
year_1                          1.292202  1        1.136750
acha_12months_any_anorexia      1.385895  1        1.177240
acha_12months_any_anxiety       1.539437  1        1.240741
acha_12months_any_bulimia       1.357240  1        1.165006
acha_12months_any_blood         1.641962  1        1.281391
acha_12months_any_bronchitis    1.282037  1        1.132271
acha_12months_any_cholesterol   1.749921  1        1.322846
acha_12months_any_depression    1.474820  1        1.214422
acha_12months_any_herpes        1.312081  1        1.145461
acha_12months_any_hpv           1.100768  1        1.049175
acha_12months_any_HIV           1.000041  1        1.000021
acha_12months_any_seasonal      1.234406  1        1.111038
acha_12months_any_substance     1.157779  1        1.076001
acha_12months_any_chlamydia     1.267401  1        1.125789
acha_12months_any_mononucleosis 1.250364  1        1.118197
acha_12months_any_allergy       1.226155  1        1.107319
acha_12months_any_asthma        1.360707  1        1.166494
acha_12months_any_back          1.255588  1        1.120530
acha_12months_any_diabetes      1.147482  1        1.071206
acha_12months_any_ear           1.306483  1        1.143015
acha_12months_any_endometriosi  1.139945  1        1.067682
acha_12months_any_fatigure      1.406759  1        1.186069
acha_12months_any_hepatitis     1.407275  1        1.186286
acha_12months_any_pelvic        1.484279  1        1.218310
acha_12months_any_sinus         1.305845  1        1.142736
acha_12months_any_strep         1.277694  1        1.130351
acha_12months_any_stressInjury  1.124536  1        1.060442
general_health                  2.546245  4        1.123926
gad7_severity
    Mild Anxiety  Minimal Anxiety Moderate Anxiety   Severe Anxiety 
             169              149              111               80 

 No Yes 
255 153 

 No Yes 
255 255 

 No Yes 
255 255 

  0   1 
255 255 

Call:
glm(formula = gad7_anxiety_up01 ~ sex + race + year_1 + phq9_score + 
    general_health, family = binomial, data = anxietytrain_up)

Coefficients:
                         Estimate Std. Error z value Pr(>|z|)    
(Intercept)             -62.61809   57.12337  -1.096   0.2730    
sexMale                  -0.47301    0.32326  -1.463   0.1434    
raceblack                 0.13949    0.71257   0.196   0.8448    
racehispanic             -0.15011    0.59663  -0.252   0.8014    
raceother                 1.43956    0.59688   2.412   0.0159 *  
racewhite                 1.82197    0.44095   4.132  3.6e-05 ***
year_1                    0.02869    0.02851   1.006   0.3144    
phq9_score                0.44992    0.04221  10.658  < 2e-16 ***
general_healthFair       -0.06425    0.72124  -0.089   0.9290    
general_healthGood       -0.82983    0.66042  -1.257   0.2089    
general_healthPoor        1.36182    1.05475   1.291   0.1967    
general_healthVery Good  -0.34049    0.65254  -0.522   0.6018    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 707.01  on 509  degrees of freedom
Residual deviance: 343.25  on 498  degrees of freedom
AIC: 367.25

Number of Fisher Scoring iterations: 6

Call:
glm(formula = gad7_anxiety_up01 ~ sex + race + year_1 + acha_12months_any_allergy + 
    acha_12months_any_asthma + acha_12months_any_back + acha_12months_any_blood + 
    acha_12months_any_bronchitis + acha_12months_any_cholesterol + 
    acha_12months_any_diabetes + acha_12months_any_ear + acha_12months_any_endometriosi + 
    acha_12months_any_fatigure + acha_12months_any_hepatitis + 
    acha_12months_any_pelvic + acha_12months_any_sinus + acha_12months_any_strep + 
    acha_12months_any_stressInjury + acha_12months_any_tuberculosis + 
    general_health, family = binomial, data = anxietytrain_up)

Coefficients:
                                    Estimate Std. Error z value Pr(>|z|)    
(Intercept)                       -6.562e+01  5.348e+01  -1.227 0.219862    
sexMale                           -5.860e-01  2.402e-01  -2.439 0.014714 *  
raceblack                         -1.014e+00  5.788e-01  -1.752 0.079819 .  
racehispanic                       1.676e-01  4.090e-01   0.410 0.681998    
raceother                          3.127e-01  4.835e-01   0.647 0.517817    
racewhite                          8.598e-01  2.902e-01   2.963 0.003049 ** 
year_1                             3.191e-02  2.672e-02   1.194 0.232440    
acha_12months_any_allergyYes      -1.359e-03  2.189e-01  -0.006 0.995044    
acha_12months_any_asthmaYes        3.479e-01  3.193e-01   1.090 0.275874    
acha_12months_any_backYes          3.014e-01  2.203e-01   1.368 0.171325    
acha_12months_any_bloodYes         1.500e-01  5.716e-01   0.262 0.793044    
acha_12months_any_bronchitisYes    7.928e-01  6.523e-01   1.215 0.224197    
acha_12months_any_cholesterolYes   9.210e-01  5.219e-01   1.765 0.077599 .  
acha_12months_any_diabetesYes     -1.654e+00  9.145e-01  -1.809 0.070462 .  
acha_12months_any_earYes           4.113e-01  4.928e-01   0.835 0.403929    
acha_12months_any_endometriosiYes -7.926e-01  7.122e-01  -1.113 0.265798    
acha_12months_any_fatigureYes      1.641e+00  5.532e-01   2.967 0.003007 ** 
acha_12months_any_hepatitisYes    -1.281e+01  7.345e+02  -0.017 0.986085    
acha_12months_any_pelvicYes        2.329e+01  1.039e+03   0.022 0.982111    
acha_12months_any_sinusYes         3.517e-01  2.746e-01   1.281 0.200278    
acha_12months_any_strepYes        -1.379e-01  3.940e-01  -0.350 0.726307    
acha_12months_any_stressInjuryYes -9.402e-01  6.366e-01  -1.477 0.139703    
acha_12months_any_tuberculosisYes -2.576e+01  1.630e+03  -0.016 0.987394    
general_healthFair                 1.879e+00  5.216e-01   3.601 0.000317 ***
general_healthGood                 1.025e+00  4.697e-01   2.183 0.029037 *  
general_healthPoor                 4.607e+00  1.014e+00   4.544 5.51e-06 ***
general_healthVery Good            6.365e-01  4.750e-01   1.340 0.180191    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 707.01  on 509  degrees of freedom
Residual deviance: 585.68  on 483  degrees of freedom
AIC: 639.68

Number of Fisher Scoring iterations: 14

Call:
glm(formula = gad7_anxiety_up01 ~ acha_depression_01 + sex + 
    race + year_1 + acha_12months_any_anorexia + acha_12months_any_anxiety + 
    acha_12months_any_bulimia + acha_12months_any_blood + acha_12months_any_bronchitis + 
    acha_12months_any_cholesterol + acha_12months_any_depression + 
    acha_12months_any_herpes + acha_12months_any_hpv + acha_12months_any_HIV + 
    acha_12months_any_seasonal + acha_12months_any_substance + 
    acha_12months_any_chlamydia + acha_12months_any_gonorrhea + 
    acha_12months_any_mononucleosis + general_health, family = binomial, 
    data = anxietytrain_up)

Coefficients:
                                     Estimate Std. Error z value Pr(>|z|)    
(Intercept)                         -51.80620   52.54818  -0.986 0.324192    
acha_depression_01                   -0.87866    0.35738  -2.459 0.013947 *  
sexMale                              -0.22718    0.26494  -0.858 0.391168    
raceblack                            -1.30041    0.61731  -2.107 0.035154 *  
racehispanic                          0.30334    0.44300   0.685 0.493507    
raceother                             0.35896    0.51330   0.699 0.484353    
racewhite                             0.61212    0.32580   1.879 0.060268 .  
year_1                                0.02462    0.02626   0.937 0.348524    
acha_12months_any_anorexiaYes         0.52806    0.41495   1.273 0.203160    
acha_12months_any_anxietyYes          1.93254    0.27855   6.938 3.98e-12 ***
acha_12months_any_bulimiaYes         -0.11086    0.63608  -0.174 0.861642    
acha_12months_any_bloodYes            0.18127    0.61256   0.296 0.767297    
acha_12months_any_bronchitisYes       0.82715    0.72923   1.134 0.256675    
acha_12months_any_cholesterolYes      0.76941    0.56378   1.365 0.172335    
acha_12months_any_depressionYes       0.59409    0.34453   1.724 0.084650 .  
acha_12months_any_herpesYes         -15.76153  917.94403  -0.017 0.986301    
acha_12months_any_hpvYes             -1.26023    1.89565  -0.665 0.506179    
acha_12months_any_HIVYes             13.65356 2985.12155   0.005 0.996351    
acha_12months_any_seasonalYes         0.07511    0.31191   0.241 0.809702    
acha_12months_any_substanceYes       -0.37292    0.43846  -0.851 0.395036    
acha_12months_any_chlamydiaYes       -0.75734    1.04800  -0.723 0.469893    
acha_12months_any_gonorrheaYes      -12.79297 1520.03684  -0.008 0.993285    
acha_12months_any_mononucleosisYes   -1.49975    1.19181  -1.258 0.208256    
general_healthFair                    1.98638    0.58345   3.405 0.000663 ***
general_healthGood                    1.08956    0.53527   2.036 0.041799 *  
general_healthPoor                    4.67970    1.04706   4.469 7.85e-06 ***
general_healthVery Good               0.77517    0.53813   1.440 0.149729    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 707.01  on 509  degrees of freedom
Residual deviance: 513.98  on 483  degrees of freedom
AIC: 567.98

Number of Fisher Scoring iterations: 15

Call:
glm(formula = gad7_anxiety_up01 ~ acha_depression_01 + sex + 
    race + year_1 + acha_12months_any_anorexia + acha_12months_any_anxiety + 
    acha_12months_any_bulimia + acha_12months_any_blood + acha_12months_any_bronchitis + 
    acha_12months_any_cholesterol + acha_12months_any_depression + 
    acha_12months_any_herpes + acha_12months_any_hpv + acha_12months_any_HIV + 
    acha_12months_any_seasonal + acha_12months_any_substance + 
    acha_12months_any_chlamydia + acha_12months_any_gonorrhea + 
    acha_12months_any_mononucleosis + acha_12months_any_allergy + 
    acha_12months_any_asthma + acha_12months_any_back + acha_12months_any_blood + 
    acha_12months_any_bronchitis + acha_12months_any_cholesterol + 
    acha_12months_any_diabetes + acha_12months_any_ear + acha_12months_any_endometriosi + 
    acha_12months_any_fatigure + acha_12months_any_hepatitis + 
    acha_12months_any_pelvic + acha_12months_any_sinus + acha_12months_any_strep + 
    acha_12months_any_stressInjury + acha_12months_any_tuberculosis + 
    general_health, family = binomial, data = anxietytrain_up)

Coefficients: (1 not defined because of singularities)
                                     Estimate Std. Error z value Pr(>|z|)    
(Intercept)                        -6.083e+01  5.484e+01  -1.109 0.267325    
acha_depression_01                 -8.527e-01  3.699e-01  -2.305 0.021146 *  
sexMale                            -8.589e-02  2.751e-01  -0.312 0.754908    
raceblack                          -1.191e+00  6.441e-01  -1.849 0.064514 .  
racehispanic                        3.091e-01  4.658e-01   0.664 0.506917    
raceother                           1.377e-01  5.502e-01   0.250 0.802351    
racewhite                           6.793e-01  3.454e-01   1.967 0.049204 *  
year_1                              2.903e-02  2.740e-02   1.060 0.289318    
acha_12months_any_anorexiaYes       5.612e-01  4.326e-01   1.297 0.194569    
acha_12months_any_anxietyYes        1.969e+00  2.894e-01   6.804 1.02e-11 ***
acha_12months_any_bulimiaYes       -9.154e-02  6.633e-01  -0.138 0.890240    
acha_12months_any_bloodYes          2.798e-01  6.407e-01   0.437 0.662346    
acha_12months_any_bronchitisYes     6.547e-01  7.695e-01   0.851 0.394927    
acha_12months_any_cholesterolYes    7.863e-01  5.834e-01   1.348 0.177729    
acha_12months_any_depressionYes     5.103e-01  3.555e-01   1.435 0.151148    
acha_12months_any_herpesYes        -1.586e+01  9.149e+02  -0.017 0.986169    
acha_12months_any_hpvYes           -7.457e-01  1.661e+00  -0.449 0.653536    
acha_12months_any_HIVYes            2.396e+00  3.184e+03   0.001 0.999400    
acha_12months_any_seasonalYes      -6.127e-03  3.260e-01  -0.019 0.985005    
acha_12months_any_substanceYes     -4.379e-01  4.642e-01  -0.943 0.345486    
acha_12months_any_chlamydiaYes     -4.745e-01  1.085e+00  -0.437 0.661917    
acha_12months_any_gonorrheaYes     -1.248e+01  1.524e+03  -0.008 0.993467    
acha_12months_any_mononucleosisYes -1.852e+00  1.442e+00  -1.284 0.199069    
acha_12months_any_allergyYes       -1.546e-02  2.440e-01  -0.063 0.949483    
acha_12months_any_asthmaYes         1.891e-01  3.595e-01   0.526 0.598899    
acha_12months_any_backYes           2.279e-01  2.493e-01   0.914 0.360591    
acha_12months_any_diabetesYes      -2.035e+00  9.908e-01  -2.054 0.039988 *  
acha_12months_any_earYes            1.595e-01  5.615e-01   0.284 0.776395    
acha_12months_any_endometriosiYes  -1.037e+00  7.446e-01  -1.393 0.163743    
acha_12months_any_fatigureYes       1.486e+00  5.836e-01   2.547 0.010863 *  
acha_12months_any_hepatitisYes     -1.322e+01  1.105e+03  -0.012 0.990459    
acha_12months_any_pelvicYes         2.591e+01  1.563e+03   0.017 0.986772    
acha_12months_any_sinusYes          2.697e-01  3.118e-01   0.865 0.386968    
acha_12months_any_strepYes          7.625e-02  4.618e-01   0.165 0.868842    
acha_12months_any_stressInjuryYes  -1.201e+00  7.243e-01  -1.659 0.097193 .  
acha_12months_any_tuberculosisYes          NA         NA      NA       NA    
general_healthFair                  1.981e+00  6.005e-01   3.299 0.000969 ***
general_healthGood                  1.076e+00  5.439e-01   1.979 0.047819 *  
general_healthPoor                  5.084e+00  1.143e+00   4.450 8.60e-06 ***
general_healthVery Good             7.039e-01  5.474e-01   1.286 0.198474    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 707.01  on 509  degrees of freedom
Residual deviance: 498.49  on 471  degrees of freedom
AIC: 576.49

Number of Fisher Scoring iterations: 15

Call:
glm(formula = gad7_anxiety_up01 ~ acha_services_diagnosed1 + 
    acha_services_medication1 + acha_services_therapy1, family = binomial, 
    data = anxietytrain_up)

Coefficients:
                             Estimate Std. Error z value Pr(>|z|)  
(Intercept)                   0.65072    0.26565   2.450   0.0143 *
acha_services_diagnosed1Yes   0.28035    0.35604   0.787   0.4310  
acha_services_medication1Yes -0.28928    0.33247  -0.870   0.3843  
acha_services_therapy1Yes    -0.06037    0.34255  -0.176   0.8601  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 235.66  on 178  degrees of freedom
Residual deviance: 234.13  on 175  degrees of freedom
  (331 observations deleted due to missingness)
AIC: 242.13

Number of Fisher Scoring iterations: 4

Diagnostics

Discussion

Results

References

Braghieri, L., Levy, R., & Makarin, A. (2021). Social media and mental health. SSRN Electronic Journal, 112(11). https://doi.org/10.2139/ssrn.3919760

Kroenke, K., Spitzer, R. L., & Williams, J. B. W. (2001). The PHQ-9: Validity of a brief depression severity measure. Journal of General Internal Medicine, 16(9), 606–613. https://doi.org/10.1046/j.1525-1497.2001.016009606.x

Spitzer, R. L., Kroenke, K., Williams, J. B. W., & Löwe, B. (2006). A brief measure for assessing generalized anxiety disorder: the GAD-7. Archives of Internal Medicine, 166(10), 1092–1097. https://doi.org/10.1001/archinte.166.10.1092

Spring 2008 reference group executive summary. (n.d.). Retrieved September 20, 2025, from https://www.acha.org/wp-content/uploads/2024/07/ACHA-NCHA_Reference_Group_ExecutiveSummary_Spring2008.pdf

---
title: "Collegiate Mental Health "
author: "Audrey DeGregorio"
output: 
  flexdashboard::flex_dashboard:
    theme:
      version: 4
      bootswatch: bootstrap
      navbar-bg: "#B3CAD8"
    orientation: columns
    source_code: embed
---

```{r setup, include=FALSE}
pacman::p_load(flexdashboard, car, caret, Benchmarking, tidyverse, ggplot2)
library(tibble)

data <- read_csv("G:/My Drive/Fall 2025/MTH 369/Regression RStudio/Final Project/MentalHealthSurvey.csv")

data <- data |> 
  dplyr::select(c(RecordedDate, year_1, state_1, surveys, general_health, starts_with("phq9"), starts_with("gad7"), starts_with("acha_12months"), starts_with("acha_services"), acha_depression, sex, fulltime, international, starts_with("race")))

attach(data)




#creating race variable
data$race_white1 <- ifelse(data$race_white == "White - not Hispanic (includes Middle Eastern)", 1, 0)
data$race_asian1 <- ifelse(data$race_asian == "Asian or Pacific Islander", 1, 0)
data$race_black1 <- ifelse(data$race_black == "Black - not Hispanic", 1, 0)
data$race_hispanic1 <- ifelse(data$race_hispanic == "Hispanic or Latino", 1, 0)
data$race_native1 <- ifelse(data$race_native == "American Indian or Alaskan Native", 1, 0)
data$race_other1 <- ifelse(data$race_other == "Other", 1, 0)

race_count <- apply(data[,71:76], 1, function(x) sum(x, na.rm=T))

data <- data %>%
  mutate(race_count_other = case_when(race_count > 1 ~ TRUE))


data <- data %>%
  mutate(race = case_when(race_count > 1 ~ "other",
                          race_white1 == "1" ~ "white",
                          race_black1 == "1" ~ "black",
                          race_hispanic1 == "1" ~ "hispanic",
                          race_native1 == "1" ~ "native",
                          race_asian1 == "1" ~ "asian",
                          race_other1 == "1" ~ "other"))

glimpse(data)

data <- data |> 
  dplyr::select(c(RecordedDate, year_1, state_1, surveys, general_health, starts_with("phq9"), starts_with("gad7"), starts_with("acha_12months"), starts_with("acha_services"), acha_depression, sex, fulltime, international, race))







# phq9 

data <- data %>%
  mutate(phq9_interest1 = case_when(
                          phq9_interest == "Not at all" ~ 0,
                          phq9_interest == "Several days" ~ 1,
                          phq9_interest == "More than half of the days" ~ 2,
                          phq9_interest == "Nearly every day" ~ 3),
        phq9_depressed1 = case_when(
                          phq9_depressed == "Not at all" ~ 0,
                          phq9_depressed == "Several days" ~ 1,
                          phq9_depressed == "More than half of the days" ~ 2,
                          phq9_depressed == "Nearly every day" ~ 3),
        phq9_sleep1 = case_when(
                          phq9_sleep == "Not at all" ~ 0,
                          phq9_sleep == "Several days" ~ 1,
                          phq9_sleep == "More than half of the days" ~ 2,
                          phq9_sleep == "Nearly every day" ~ 3),
        phq9_tired1 = case_when(
                          phq9_tired == "Not at all" ~ 0,
                          phq9_tired == "Several days" ~ 1,
                          phq9_tired == "More than half of the days" ~ 2,
                          phq9_tired == "Nearly every day" ~ 3),
        phq9_appetite1 = case_when(
                          phq9_appetite == "Not at all" ~ 0,
                          phq9_appetite == "Several days" ~ 1,
                          phq9_appetite == "More than half of the days" ~ 2,
                          phq9_appetite == "Nearly every day" ~ 3),
        phq9_failure1 = case_when(
                          phq9_failure == "Not at all" ~ 0,
                          phq9_failure == "Several days" ~ 1,
                          phq9_failure == "More than half of the days" ~ 2,
                          phq9_failure == "Nearly every day" ~ 3),
        phq9_concentrating1 = case_when(
                          phq9_concentrating == "Not at all" ~ 0,
                          phq9_concentrating == "Several days" ~ 1,
                          phq9_concentrating == "More than half of the days" ~ 2,
                          phq9_concentrating == "Nearly every day" ~ 3),
        phq9_speed1 = case_when(
                          phq9_speed == "Not at all" ~ 0,
                          phq9_speed == "Several days" ~ 1,
                          phq9_speed == "More than half of the days" ~ 2,
                          phq9_speed == "Nearly every day" ~ 3),
        phq9_selfharm1 = case_when(
                          phq9_selfharm == "Not at all" ~ 0,
                          phq9_selfharm == "Several days" ~ 1,
                          phq9_selfharm == "More than half of the days" ~ 2,
                          phq9_selfharm == "Nearly every day" ~ 3),
        phq9_score = (phq9_interest1 + phq9_depressed1 +  phq9_sleep1 + 
                          phq9_tired1 + phq9_appetite1 + phq9_failure1 + 
                          phq9_concentrating1 + phq9_speed1 + phq9_selfharm1),
        phq9_severity = case_when(
                          phq9_score <= 4 ~ "None-minimal",
                          phq9_score > 4 & phq9_score <= 9 ~ "Mild",
                          phq9_score >= 10 & phq9_score <= 14 ~ "Moderate",
                          phq9_score >= 15 & phq9_score <= 19 ~ "Moderately Severe",
                          phq9_score >= 20 ~ "Severe")
                  
        )
        
       



 
# gad7

data <- data %>%
  mutate(gad7_anxious1 = case_when(
                          gad7_anxious == "Not at all" ~ 0,
                          gad7_anxious == "Several days" ~ 1,
                          gad7_anxious == "More than half of the days" ~ 2,
                          gad7_anxious == "Nearly every day" ~ 3),
        gad7_control1 = case_when(
                          gad7_control == "Not at all" ~ 0,
                          gad7_control == "Several days" ~ 1,
                          gad7_control == "More than half of the days" ~ 2,
                          gad7_control == "Nearly every day" ~ 3),
        gad7_worrying1 = case_when(
                          gad7_worrying == "Not at all" ~ 0,
                          gad7_worrying == "Several days" ~ 1,
                          gad7_worrying == "More than half of the days" ~ 2,
                          gad7_worrying == "Nearly every day" ~ 3),
        gad7_relaxing1 = case_when(
                          gad7_relaxing == "Not at all" ~ 0,
                          gad7_relaxing == "Several days" ~ 1,
                          gad7_relaxing == "More than half of the days" ~ 2,
                          gad7_relaxing == "Nearly every day" ~ 3),
        gad7_restless1 = case_when(
                          gad7_restless == "Not at all" ~ 0,
                          gad7_restless == "Several days" ~ 1,
                          gad7_restless == "More than half of the days" ~ 2,
                          gad7_restless == "Nearly every day" ~ 3),
        gad7_annoyed1 = case_when(
                          gad7_annoyed == "Not at all" ~ 0,
                          gad7_annoyed == "Several days" ~ 1,
                          gad7_annoyed == "More than half of the days" ~ 2,
                          gad7_annoyed == "Nearly every day" ~ 3),
        gad7_afraid1 = case_when(
                          gad7_afraid == "Not at all" ~ 0,
                          gad7_afraid == "Several days" ~ 1,
                          gad7_afraid == "More than half of the days" ~ 2,
                          gad7_afraid == "Nearly every day" ~ 3),
        gad7_score = (gad7_anxious1 + gad7_control1 + gad7_worrying1 + 
                          gad7_relaxing1 + gad7_restless1 + gad7_annoyed1 + 
                          gad7_afraid1),
        gad7_severity = case_when(
                          gad7_score <= 4 ~ "Minimal Anxiety",
                          gad7_score > 4 & gad7_score <= 9 ~ "Mild Anxiety",
                          gad7_score >= 10 & gad7_score <= 14 ~ "Moderate Anxiety",
                          gad7_score >= 15 ~ "Severe Anxiety"))


# ACHA depression diagnosis cleaning

data <- data %>%
  mutate(acha_services_diagnosed1 = case_when(
                                acha_depression == "No" ~ NA,
                                TRUE ~ acha_services_dianosed),
         acha_services_therapy1 = case_when(
                                acha_depression == "No" ~ NA,
                                TRUE ~ acha_services_therapy),
         acha_services_medication1 = case_when(
                                acha_depression == "No" ~ NA,
                                TRUE ~ acha_services_medication))

attach(data)

```

Introduction
===

Column { data-width=500}
-----------------------------------------------------------------------

### <font size=4><span Style = "color:#2C7BB6">  Background</span></font>

 The purpose of this project is to explore relationships among mental and physical health issues, and predictors of anxiety and depression among college students. While mental health is sometimes hard to measure, there are standardized methods developed to help psychologists evaluate the presence and severity of certain mental health indicators. In this project, we will focus mainly on depression and anxiety disorders in relation to overall mental health. 
 
 Our physical and mental health are not distinct from each other. It is important to view health from an overall perspective, because all areas of our lives cross over into each other. 
 
 

### <font size=4><span Style = "color:#2C7BB6">  Research Questions</span></font>
 
 - What physical health issues are related to mental health outcomes? 
 - How does the physical health and mental health (depression/anxiety scores) of students who receive mental health treatment (therapy, medication) compare to students that do not?
 - Are mental and physical health problems consistent across sex, race, and age?
 
  

 
Column {.tabset data-width=500}
-----------------------------------------------------------------------

<font size=4><span Style = "color:#2C7BB6">  Data Description</span></font>

### Source
  The data set comes from a study based on social media's affects on college students' mental health (Braghieri, et. al 2021). The data includes variables with information from PHQ-9 Depression Screening Surveys and GAD-7 Anxiety Screening Surveys. Both are highly reliable and valid in medical diagnoses. Additionally, there are survey questions derived from the American College Health Association (ACHA)'s National College Health Assessment (NCHA). This data set was originally used to evaluate the validity of the NCHA by comparing the outcomes to the PHQ-9 and the GAD-7, both of which were highly correlated to the poor mental health predictors of the NCHA. There are 509 observations.
  
```{r}
glimpse(data)

```



### PHQ-9

The [PHQ-9](https://doi.org/10.1046/j.1525-1497.2001.016009606.x) is a standardized survey used to screen and diagnose depression. Participants are asked how often they have been bothered by nine specific problems over the past two weeks and respond with one of the four answers:

1. Not at all (+0)
2. Several days(+1)
3. More than half the days (+2)
4. Nearly everyday (+3)

The nine prompts consist of the following: 

  1. Little interest or pleasure in doing things 
  2. Feeling down, depressed or hopeless 
  3. Trouble falling asleep, staying asleep, or sleeping too much 
  4. Feeling tired or having little energy 
  5. Poor appetite or overeating 
  6. Feeling bad about yourself - or that you’re a failure or have let yourself or your family down 
  7. Trouble concentrating on things, such as reading the newspaper or watching television 
  8. Moving or speaking so slowly that other people could have noticed. Or, the opposite - being so fidgety or restless that you have been moving around a lot more than usual 
  9. Thoughts that you would be better off dead or of hurting yourself in some way
  
  
Surveys are then scored and indicate levels of depression based on this scale:

- **0-4** None-minimal
- **5-9** Mild
- **10-14** Moderate
- **15-19** Moderately Severe
- **20-27** Severe




### GAD-7

Similar to the PHQ-9, the [GAD-7](https://doi.org/10.1001/archinte.166.10.1092) another is standardized survey, but it is used to screen generalized anxiety disorder. Participants are asked how often they have been bothered by seven specific problems over the past two weeks and respond with one of the four answers:

1. Not at all (+0)
2. Several days(+1)
3. More than half the days (+2)
4. Nearly everyday (+3+)

The nine prompts consist of the following: 

  1. Feeling nervous, anxious or on edge 
  2. Not being able to stop or control worrying
  3. Worrying too much about different things
  4. Trouble relaxing 
  5. Being so restless that it is hard to sit still
  6. Becoming easily annoyed or irritable
  7. Feeling afraid as if something awful might happen
  
  
Surveys are then scored and indicate levels of anxiety based on this scale:

- **0-4** Minimal anxiety
- **5-9** Mild anxiety
- **10-14** Moderate anxiety
- **15+** Severe anxiety


### NCHA

The [National College Health Assessment](https://www.acha.org/wp-content/uploads/2024/07/ACHA-NCHA_Reference_Group_ExecutiveSummary_Spring2008.pdf) is a semi-annual survey administered to college students by the ACHA. The current data utilizes the survey questions, but not the data collected from the ACHA. 

The data includes the following prompts from the survey:

**Depression Symptoms:**

- Feeling things were hopeless
- Feeling overwhelmed by all they had to do
- Feeling very sad
- Feeling so depressed it was difficult to
function
- Seriously considering attempting suicide
- Attempting suicide

*Possible Responses:*

- Never
- 1-2 times 
- 3-4 times
- 5-6 times
- 7-8 times
- 9-10 times
- 11 or more times


**General Health Indicators:**
Reported any of the following in the past 12 months:

- Allergy problems
- Anorexia
- Anxiety disorder
- Asthma
- Bulimia
- Chronic fatigue syndrome
- Depression
- Diabetes
- Endometriosis
- Genital herpes
- Genital warts/HPV
- Hepatitis B or C
- High blood pressure
- High cholesterol
- HIV infection
- Repetitive stress injury
- Seasonal affective disorder
- Substance abuse problem
- Back pain
- Broken bone/fracture
- Bronchitis
- Chlamydia
- Ear infection
- Gonorrhea
- Mononucleosis
- Pelvic inflammatory disease
- Sinus infection
- Strep throat
- Tuberculosis

*Possible Responses:*

 - Yes/No
 - NA
 
 
If diagnosed with depression:

 - Diagnosed with depression in the last school year
 - Currently in therapy for depression
 - Currently taking medication for depression

*Possible Responses:*

- Yes/No
- NA


### Data Cleaning

Many variables that were not useful for the research questions and were removed from the data set. Most of these include timestamps from clicks in the survey and other online browser information.

Other variables were created and transformed for ease of use. For example, race was condensed into one category with information for all races as opposed to 6 different variables with two levels. 

Additionally, variables were created to represent the overall depression and anxiety scores from the PHQ-9 and GAD-7 screening results.


EDA
=================


Column { .tabset data-width=400}
---------------------------------------
<font size=4><span Style = "color:#2C7BB6">Discussion</span></font>


### PHQ-9:GAD-7

**Figure 1**

This graph provides some insight into the relationship between overall PHQ-9 and GAD-7 scores. The R-Squared = 0.605 and the regression line is fitted by a linear regression between the variables. There is a moderate, positive relationship between the depression and anxiety scores based on these survey questions.


### PHQ-9 Results

**Figure 2**

Figure 2 shows the distribution of depression severity based on the PHQ-9. Most students fall under the Mild category, with less having more severe scores. 

### GAD-7 Results

**Figure 3**

Figure 3 shows the distribution of anxiety severity based on the GAD-7. The results are similar to the distribution of depression, with most students exhibiting symptoms equivalent to mild anxiety and less facing severe symptoms.

### Sex

**Figure 4**

Figure 4 shows how many male and female students are included in the dataset. There are approximately 350 females and 150 males.

### Race

**Figure 5**

Most students identify as white, with almost 300 students reporting so. All students who idenfied as more than one race are classified as "other".

### Age

**Figure 6**

Most students were born in the year 2000, with a long tail representing multiple older students also represented in the sample. **Note:** This data was collected in January 2022, so most students born in 2000 are around 21 years old.

### Physical Health

**Figure 7**

This graph shows the amount of people who responded "yes" to experiencing each of the symptoms/disorders listed in the past 12 months. Anxiety, depression, allergies, and back pain are among the most common. 

It is worth noting these measures of depression and anxiety are different from the PHQ-9 and GAD-7 scales, and were an independent, self-reported question in the NCHA questionnaire.




Column {.tabset data-width=600}
-----------------------------------

<font size=4><span Style = "color:#2C7BB6">Corresponding Graphs</span></font>


### Fig. 1

```{r fig. 1 phq9 gad7 cor}
ggplot(data, aes(phq9_score, gad7_score)) +
  geom_point() +
  labs(title = "PHQ-9 and GAD-7 Correlation", x = "PHQ-9 Score", y = "GAD-7 Score") +
  geom_smooth(method = "lm", se = FALSE, col = "#C7A9A1")

```


### Fig. 2
```{r fig.2 phq9 bar}
data$phq9_severity <- factor(data$phq9_severity, 
                  levels = c("None-minimal", "Mild", "Moderate", "Moderately Severe", "Severe"))
ggplot(data,aes(phq9_severity)) +
  geom_bar(fill = "#C7A9A1") +
  labs(title = "PHQ-9 Results", x = "Severity")
```
 


### Fig. 3
```{r fig.3 gad7 bar}
data$gad7_severity <- factor(data$gad7_severity, 
                  levels = c("Minimal Anxiety", "Mild Anxiety", "Moderate Anxiety", "Severe Anxiety"))

ggplot(data,aes(gad7_severity)) +
  geom_bar(fill = "#C7A9A1") +
  labs(title = "GAD-7 Results", x = "Severity")
```


### Fig. 4
```{r sex}
ggplot(data, aes(sex)) +
  geom_bar(fill="#C7A9A1") +
  labs(title = "Sex Distribution", x = "Sex")
```


### Fig. 5
```{r race}
ggplot(data, aes(race)) +
  geom_bar(fill="#C7A9A1") +
  labs(title = "Race Distribution", x = "Race") 
```



### Fig. 6
```{r age}
ggplot(data, aes(year_1)) +
  geom_bar(fill="#C7A9A1") +
  labs(title = "Age Distribution", x = "Birth Year") 
```


### Fig. 7
```{r}
acha <- data %>%
  pivot_longer(
    cols = c(acha_12months_any_allergy:acha_12months_any_tuberculosis),     #
    names_to = "variable",
    values_to = "response") %>%
  filter(response == "Yes")


ggplot(acha, aes(x = variable, fill = response)) +
  geom_bar(position = "dodge") +
  scale_fill_manual(values = c("Yes" = "#C7A9A1")) +
   scale_x_discrete(labels = c(
    acha_12months_any_allergy = "Allergy",
    acha_12months_any_anorexia = "Anorexia",
    acha_12months_any_anxiety = "Anxiety",
    acha_12months_any_asthma = "Asthma",
    acha_12months_any_back = "Back Pain",
    acha_12months_any_blood = "High BP",
    acha_12months_any_bronchitis = "Bronchitis",
    acha_12months_any_bulimia = "Bulimia",
    acha_12months_any_cholesterol  = "High Cholesterol",
    acha_12months_any_depression = "Depression",
    acha_12months_any_diabetes = "Diabetes",
    acha_12months_any_ear = "Ear Infection",
    acha_12months_any_endometriosi = "Endometriosis",
    acha_12months_any_fatigure = "Chronic Fatigue",
    acha_12months_any_fracture = "Broken Bone",
    acha_12months_any_gonorrhea = "Gonorrhea",
    acha_12months_any_hepatitis = "Hepatitis",
    acha_12months_any_herpes = "Genital Herpes",
    acha_12months_any_HIV = "HIV",
    acha_12months_any_hpv = "HPV",
    acha_12months_any_mononucleosis = "Mononucleosis",
    acha_12months_any_pelvic = "Pelvic Inflammatory Disease",
    acha_12months_any_seasonal = "Seasonal Affective Disorder",
    acha_12months_any_sinus = "Sinus Infection",
    acha_12months_any_strep = "Strep Throat",
    acha_12months_any_substance = "Substance Abuse Disorder",
    acha_12months_any_tuberculosis = "Tuberculosis",
    acha_12months_any_chlamydia = "Chlamydia",
    acha_12months_any_stressInjury = "Repetitive Stress Injury")) +
  labs(title = "NCHA Questionnaire Results",x = "Report Experiencing in the Past 12 Months", y = "Count") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1), legend.position = "none")


```




Methods
===

Column {.tabset data-width=700}
---

### 1



### 2

gekk


Column {.tabset data-width=300}
---


### Model

```{r depression}
data <- data %>%
  mutate(acha_depression_01 =
           case_when(acha_depression == "Yes" ~ 1,
                     acha_depression == "No" ~ 0)
             
           )

set.seed(2626)
train_index <- createDataPartition(data$acha_depression_01, p = 0.8, list = FALSE)
train <- data[train_index,]
test <- data[-train_index,]

table(train$acha_depression)
table(test$acha_depression)




logit_model <- glm(acha_depression_01 ~ sex + race + year_1 + phq9_score + gad7_score + general_health, data = train, family = binomial)
summary(logit_model)

logit_model2 <- glm(acha_depression_01 ~ sex + race + year_1 + acha_12months_any_allergy + acha_12months_any_asthma + acha_12months_any_back + acha_12months_any_blood +acha_12months_any_bronchitis + acha_12months_any_cholesterol +acha_12months_any_diabetes + acha_12months_any_ear +acha_12months_any_endometriosi +acha_12months_any_fatigure +acha_12months_any_hepatitis +acha_12months_any_pelvic +acha_12months_any_sinus+ acha_12months_any_strep +acha_12months_any_stressInjury+ acha_12months_any_tuberculosis + general_health, data = train, family = binomial)
summary(logit_model2)


model_train3 <- glm(acha_depression_01 ~ sex + race + year_1 + acha_12months_any_anorexia + acha_12months_any_anxiety + acha_12months_any_bulimia + acha_12months_any_blood +acha_12months_any_bronchitis + acha_12months_any_cholesterol +acha_12months_any_depression + acha_12months_any_herpes +acha_12months_any_hpv +acha_12months_any_HIV +acha_12months_any_seasonal +acha_12months_any_substance +acha_12months_any_chlamydia+ acha_12months_any_gonorrhea +acha_12months_any_mononucleosis + general_health, data = train, family = binomial)
summary(model_train3)

table(acha_12months_any_gonorrhea)
table(train$acha_12months_any_gonorrhea)

model_train4 <- glm(acha_depression_01 ~ sex + race + year_1 + acha_12months_any_anorexia + acha_12months_any_anxiety + acha_12months_any_bulimia + acha_12months_any_blood +acha_12months_any_bronchitis + acha_12months_any_cholesterol +acha_12months_any_depression + acha_12months_any_herpes +acha_12months_any_hpv +acha_12months_any_HIV +acha_12months_any_seasonal +acha_12months_any_substance +acha_12months_any_chlamydia +acha_12months_any_mononucleosis+ acha_12months_any_allergy + acha_12months_any_asthma + acha_12months_any_back + acha_12months_any_blood +acha_12months_any_bronchitis + acha_12months_any_cholesterol +acha_12months_any_diabetes + acha_12months_any_ear +acha_12months_any_endometriosi +acha_12months_any_fatigure +acha_12months_any_hepatitis +acha_12months_any_pelvic +acha_12months_any_sinus+ acha_12months_any_strep +acha_12months_any_stressInjury+ general_health, data = train, family = binomial)
summary(model_train4)

table(acha_12months_any_tuberculosis)

vif(model_train4)
```

```{r anxiety}

## 10 is the general cut off for clinical intervention

table(gad7_severity)

data <- data %>%
  mutate(gad7_anxiety =
           case_when(gad7_severity == "Mild Anxiety" |gad7_severity == "Minimal Anxiety" ~ "No",
                     gad7_severity == "Moderate Anxiety" | gad7_severity =="Severe Anxiety" ~ "Yes"))

data$gad7_anxiety <- as.factor(data$gad7_anxiety)

set.seed(2626)
train_index <- createDataPartition(data$gad7_anxiety, p = 0.8, list = FALSE)
train <- data[train_index,]
test <- data[-train_index,]

table(train$gad7_anxiety)

anxietytrain_up <- upSample(x = train[, -which(names(train) == "gad7_anxiety")],
                       y = train$gad7_anxiety)


table(anxietytrain_up$Class)

names(anxietytrain_up)[ncol(anxietytrain_up)] <- "gad7_anxiety_up"


table(anxietytrain_up$gad7_anxiety_up)


anxietytrain_up <- anxietytrain_up %>%
  mutate(gad7_anxiety_up01 =
           case_when(gad7_anxiety_up == "Yes" ~ 1,
                     gad7_anxiety_up == "No" ~ 0)
             
           )

table(anxietytrain_up$gad7_anxiety_up01)

anx_model <- glm(gad7_anxiety_up01 ~ sex + race + year_1 + phq9_score + general_health, data = anxietytrain_up, family = binomial)
summary(anx_model)

anx_model2 <- glm(gad7_anxiety_up01 ~ sex + race + year_1 + acha_12months_any_allergy + acha_12months_any_asthma + acha_12months_any_back + acha_12months_any_blood +acha_12months_any_bronchitis + acha_12months_any_cholesterol +acha_12months_any_diabetes + acha_12months_any_ear +acha_12months_any_endometriosi +acha_12months_any_fatigure +acha_12months_any_hepatitis +acha_12months_any_pelvic +acha_12months_any_sinus+ acha_12months_any_strep +acha_12months_any_stressInjury+ acha_12months_any_tuberculosis + general_health, data = anxietytrain_up, family = binomial)
summary(anx_model2)



anx_model3 <- glm(gad7_anxiety_up01 ~ acha_depression_01 + sex + race + year_1 + acha_12months_any_anorexia + acha_12months_any_anxiety + acha_12months_any_bulimia + acha_12months_any_blood +acha_12months_any_bronchitis + acha_12months_any_cholesterol +acha_12months_any_depression + acha_12months_any_herpes +acha_12months_any_hpv +acha_12months_any_HIV +acha_12months_any_seasonal +acha_12months_any_substance +acha_12months_any_chlamydia+ acha_12months_any_gonorrhea +acha_12months_any_mononucleosis + general_health, data = anxietytrain_up, family = binomial)
summary(anx_model3)


anx_model4 <- glm(gad7_anxiety_up01 ~ acha_depression_01 + sex + race + year_1 + acha_12months_any_anorexia + acha_12months_any_anxiety + acha_12months_any_bulimia + acha_12months_any_blood +acha_12months_any_bronchitis + acha_12months_any_cholesterol +acha_12months_any_depression + acha_12months_any_herpes +acha_12months_any_hpv +acha_12months_any_HIV +acha_12months_any_seasonal +acha_12months_any_substance +acha_12months_any_chlamydia+ acha_12months_any_gonorrhea +acha_12months_any_mononucleosis+ acha_12months_any_allergy + acha_12months_any_asthma + acha_12months_any_back + acha_12months_any_blood +acha_12months_any_bronchitis + acha_12months_any_cholesterol +acha_12months_any_diabetes + acha_12months_any_ear +acha_12months_any_endometriosi +acha_12months_any_fatigure +acha_12months_any_hepatitis +acha_12months_any_pelvic +acha_12months_any_sinus+ acha_12months_any_strep +acha_12months_any_stressInjury+ acha_12months_any_tuberculosis + general_health, data = anxietytrain_up, family = binomial)
summary(anx_model4)



```


```{r treatment}

atreatment_model <- glm(gad7_anxiety_up01 ~ acha_services_diagnosed1 + acha_services_medication1 + acha_services_therapy1, data=anxietytrain_up, family = binomial)
summary(atreatment_model)
```

### Diagnostics



Discussion
===


### Results


### References

Braghieri, L., Levy, R., & Makarin, A. (2021). Social media and mental health. *SSRN Electronic Journal, 112*(11). https://doi.org/10.2139/ssrn.3919760

Kroenke, K., Spitzer, R. L., & Williams, J. B. W. (2001). The PHQ-9: Validity of a brief depression severity measure. *Journal of General Internal Medicine, 16*(9), 606–613. https://doi.org/10.1046/j.1525-1497.2001.016009606.x

Spitzer, R. L., Kroenke, K., Williams, J. B. W., & Löwe, B. (2006). A brief measure for assessing generalized anxiety disorder: the GAD-7. *Archives of Internal Medicine, 166*(10), 1092–1097. https://doi.org/10.1001/archinte.166.10.1092

*Spring 2008 reference group executive summary.* (n.d.). Retrieved September 20, 2025, from https://www.acha.org/wp-content/uploads/2024/07/ACHA-NCHA_Reference_Group_ExecutiveSummary_Spring2008.pdf